package com.czkt.springboot_mybatis_test.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.czkt.springboot_mybatis_test.entity.CstLost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface CstLostMapper extends BaseMapper<CstLost> {
    @Select("select count(*) from cst_lost where lst_cust_name like concat('%',#{lstCustName},'%')  and lst_cust_manager_name like concat('%',#{lstCustManagerName},'%');")
    Integer cstLostCount(@Param("lstCustName")String lstCustName,@Param("lstCustManagerName") String lstCustManagerName);

    @Select("select * from cst_lost where lst_cust_name like concat('%',#{lstCustName},'%')  and lst_cust_manager_name like concat('%',#{lstCustManagerName},'%') limit #{pageIndex},#{pageSize};")
    List<CstLost> selectCstLost(@Param("lstCustName")String lstCustName,@Param("lstCustManagerName") String lstCustManagerName,@Param("pageIndex")Integer pageIndex,@Param("pageSize") Integer pageSize);

}
